]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
grabHelper: Support optional parameters to pushModal()
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 20 Aug 2012 20:05:00 +0000 (22:05 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 17 Nov 2012 00:44:22 +0000 (01:44 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=688202

js/ui/grabHelper.js

index 8b81b1994bb62dd15b37fdc39ec0b7b6e06c8205..3623a0f662cd0aa64ec822d953991b0915163cfc 100644 (file)
@@ -23,6 +23,7 @@ function _navigateActor(actor) {
 
 // GrabHelper:
 // @owner: the actor that owns the GrabHelper
+// @params: optional parameters to pass to Main.pushModal()
 //
 // Creates a new GrabHelper object, for dealing with keyboard and pointer grabs
 // associated with a set of actors.
@@ -34,8 +35,9 @@ function _navigateActor(actor) {
 const GrabHelper = new Lang.Class({
     Name: 'GrabHelper',
 
-    _init: function(owner) {
+    _init: function(owner, params) {
         this._owner = owner;
+        this._modalParams = params;
 
         this._grabStack = [];
 
@@ -165,7 +167,7 @@ const GrabHelper = new Lang.Class({
     _takeModalGrab: function() {
         let firstGrab = (this._modalCount == 0);
         if (firstGrab) {
-            if (!Main.pushModal(this._owner))
+            if (!Main.pushModal(this._owner, this._modalParams))
                 return false;
 
             this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));